package com.xyoto.takeawayBusiness.mapper;


import com.xyoto.takeawayBusiness.dto.MenuTypeDTO;
import com.xyoto.takeawayBusiness.dto.UpdateTypeDTO;
import com.xyoto.takeawayBusiness.entity.ShoppingType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 *
 * @author TingFeng
 * @since 2022-04-26
 */
@Mapper
public interface ShoppingTypeMapper  {

    /**
     * 判断商品类别是否存在
     * @param shoppingTypeId 商品类别id
     * @return
     */
    Integer isExistShoppingType(Integer shoppingTypeId);

    /**
     * 添加商品分类
     * @param shoppingType
     */
    Integer addType(ShoppingType shoppingType);

    /**
     * 获取商品分类数量
     * @return
     */
    Short getTypeCount(Integer shopId);

    /**
     * 修改商品分类
     * @param  shoppingType
     * @return
     */
    Integer updateType(ShoppingType shoppingType);

    /**
     * 菜单分类id查询店铺id
     * @param id
     * @return
     */
    Integer findShopIdByShopTypeId(Integer id);

    /**
     * 删除菜单分类
     * @param menuId
     */
    Integer deleteType(Integer menuId);

    /**
     * 获取最大商品排序数值
     * @param shopId
     * @return
     */
    short findOrderMax(Integer shopId);


}
